package com.cq.hd.admin.controller;

import com.cq.hd.admin.annotation.RequiresPermissionsDesc;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.TbAppUserApi;
import com.cq.hd.member.api.dto.AppUserPageDto;
import com.cq.hd.member.api.vo.AppUserPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * app用户表 前端控制器
 * </p>
 *
 * @author mYunYu
 * @since 2023-11-21
 */
@Api(tags = "注册用户相关接口")
@Slf4j
@RestController
@RequestMapping("/appUser")
public class TbAppUserController {

    private TbAppUserApi appUserApi;

    @Autowired
    public void setAppUserApi(TbAppUserApi appUserApi) {
        this.appUserApi = appUserApi;
    }

    @ApiOperation(value = "注册用户列表")
    @ApiImplicitParam(name = "appUserPageDto", value = "实体", paramType = "query", dataType = "AppUserPageDto")
    @ApiResponse(response = AppUserPageVo.class, code = 200, message = "接口返回对象参数")
    @RequiresPermissions("appUser:appUser:list")
    @RequiresPermissionsDesc(menu = {"注册用户管理", "注册用户管理"}, button = "查询")
    @GetMapping("/page")
    public Result<Page<AppUserPageVo>> pageAppUser(AppUserPageDto appUserPageDto) {
        return appUserApi.pageAppUser(appUserPageDto);
    }
}
